package ch.rheintalconnection.sysventory.technicalServices;

import java.util.regex.Pattern;

import ch.rheintalconnection.sysventory.domain.ScanEntry;

public class DataValidator {

	// filterParameters with '.*' for zero or more characters and '.' for a single character
	public Boolean vertifyScanEntry(ScanEntry scanEntry,
			String filterComputerName, String filterIpAddress,
			String filterProcessorFamily, String filterComputerType,
			String filterOsDescription)
	{
		
		String computerName = scanEntry.getComputer().getComputerName();
		String ipAddress = scanEntry.getNic().getIpAddress().toString();
		String processorFamily = scanEntry.getProcessor().getFamily();
		String computerType = scanEntry.getComputer().getComputerType();
		String osDescription = scanEntry.getOs().getDescription();
		
		Boolean result = (Pattern.matches(filterComputerName, computerName)
		&& Pattern.matches(filterIpAddress, ipAddress)
		&& Pattern.matches(filterProcessorFamily, processorFamily)
		&& Pattern.matches(filterComputerType, computerType)
		&& Pattern.matches(filterOsDescription, osDescription));
		
		return result;
	}
	
}
